#version 330 core
out vec4 FragColor;

in VS_OUT
{
    vec2 TexCoords;
} fs_in;

// texture samplers
uniform sampler2D texture1;
uniform sampler2D texture2;

uniform float ratio;

void main()
{
        // linearly interpolate between both textures (80% container, 20% awesomeface)
        //FragColor = mix(texture2D(texture1, TexCoord), texture2D(texture2, TexCoord), ratio);
#if 0
    //gl_FragCoord的x和y分量是片段的窗口空间(Window-space)坐标，其原点为窗口的左下角。
    //z分量等于对应片段的深度值
    if(gl_FragCoord.x < 400)
        FragColor = vec4(1.0, 0.0, 0.0, 1.0);
    else
        FragColor = vec4(0.0, 1.0, 0.0, 1.0);
#endif
#if 0
    if(gl_FrontFacing)
        FragColor = texture2D(texture1, TexCoord);
    else
        FragColor = texture2D(texture2, TexCoord);
#endif

    FragColor = texture(texture1, fs_in.TexCoords);


    //FragColor = vec4(1.0, 1.0, 0.0, 1.0);
}
